﻿Imports sstools.GenericExcelExporter

<ExportEntity(
    WorkSheetName:="MapEntities Approach",
    BorderLineStyle:=sstools.GenericExcelExporter.XlLineStyle.xlContinuous,
    BorderWeight:=sstools.GenericExcelExporter.XlBorderWeight.xlThin,
    BorderColor:="Black"
    )>
Public Class CustomEmployee
    <ExportMember(Order:=2, ColumnName:="First Name", BackgroundColor:="#A8F000")>
    Public Property FirstName() As String

    <ExportMember(Order:=1, ColumnName:="Last Name", BackgroundColor:="#A8F000")>
    Public Property LastName() As String

    <ExportMember(Order:=0, ColumnName:="ID", HAlign:=XlHAlign.xlHAlignLeft, BackgroundColor:="#810051", ForegroundColor:="White")>
    Public Property ContactID() As Integer

    <ExportMember(Order:=3, ColumnName:="Email", HAlign:=XlHAlign.xlHAlignRight)>
    Public Property EmailAddress As String

    <ExportMember(Order:=5, ColumnName:="Modified", ValueFormatterFuncName:="DateFormatter")>
    Public Property ModifiedDate As Date

    <ExportMember(Order:=4, BackgroundColor:="#8BB42D")>
    Public Property Address As CustomAddress

    Public Shared Function DateFormatter(inp As Date) As String
        Return inp.ToString("yyyy-MM-dd")
    End Function
End Class

Public Class CustomAddress
    <ExportMember(Order:=24)>
    Public Property City As String

    <ExportMember(Order:=35, BackgroundColor:="#E366B5")>
    Public Property State As CustomStateProvince
End Class

Public Class CustomStateProvince
    <ExportMember(Order:=4)>
    Public Property Name As String

    <ExportMember(Order:=4, ColumnName:="CC")>
    Public Property CountryCode As String

    <ExportMember(Order:=3, BackgroundColor:="#A8F000")>
    Public Property Territory As CustomTerritory
End Class

Public Class CustomTerritory
    <ExportMember(Order:=1)>
    Public Property Name As String

    <ExportMember(Order:=2, BackgroundColor:="#E339A4")>
    Public Property Group As String

    <ExportMember(Order:=3, ColumnName:="Sales")>
    Public Property SalesLastYear As Decimal

    <ExportMember(Order:=4)>
    Public Property CostLastYear As Decimal
End Class
